package com.lk.common.comet4j;


import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.comet4j.core.CometContext;

public class Comet4jRegister implements ServletContextListener {
        public void contextInitialized(ServletContextEvent arg0) {
                CometContext cc = CometContext.getInstance();
                //注册三个通道
                cc.registChannel(MessageType.NOTICE.getValue());
                cc.registChannel(MessageType.MESSAGE.getValue());
                cc.registChannel(MessageType.TODO.getValue());
        }

        public void contextDestroyed(ServletContextEvent arg0) {
        	CometContext cometContext = CometContext.getInstance();
    		cometContext.removeAllListener();
        }
}